﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.Windows.Data;

namespace SoftHelper.Tool
{
    public class NumberCOnverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            long longValue = (long)value;
            if (longValue==0)
            {
                return "0";
               
            }else if (longValue < 10000)
            {
                return "一千-";
            }
            else if (longValue >=10000 && longValue <= 100000)
            {
                return "一千+";
            }
            else if (longValue >=100000 && longValue <=1000000)
            {
                return "1万+";

            }
            else if(longValue >= 1000000 && longValue <= 100000000)
            {
                return "10万+";
            }
            else if(longValue>= 100000000 && longValue <= 10000000000)
            {
                return "一千万+";
            }
            else if (longValue >= 10000000000 && longValue<= 100000000000000000)
            {
                return "10亿+";
            }
            else
            {
                return "多到系统不想计算了";
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
